package Controller.SCServlet;

import Dao.SCDao;
import bean.SC;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.ArrayList;

@WebServlet("/sc_select")
public class sc_select extends HttpServlet {
    SCDao scDao = new SCDao();
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        doPost(req, resp);
    }

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        ArrayList<SC> list = scDao.selectAll();
        req.setAttribute("scList",list);
        req.getRequestDispatcher("SCInfoSelect.jsp").forward(req,resp);
    }
}
